<?php
namespace Home\Controller;

use Think\Controller;

class AdvertisingController extends Controller
{

    public function advertising()
    {
        
        $ad=getAd();
        
        
        $advertising=M('Advertising');
        $where["id"]=$_GET['id'];
        
        $adcontent=$advertising->field('title,content,fdate')->where($where)->find();
        //if($ad)
    if(count($ad)>0){
        $this->assign("ad",$ad);
        }else{
            $ad=array(array('title'=>'<a disabled="true">暂时还没有任何广告信息！！！</a>'));
            $this->assign("ad",$ad);
        }
        
        //var_dump($_GET['id']);exit();
        $this->assign("adcontent",$adcontent);
        $this->display();
    }
}